<template>
    <section class="screen" ref="sectionRef" v-bind="setSectionRef">
        <div class="screenIn">

          <div class="screen3_container">
            <div class="screen3_title">
              <h1>G视频-音乐</h1>
            </div>
            
            <div class="screen3_demo">
              <video src="../../images/index.mp4" autoplay loop muted></video>
            </div>
          </div>
          
        </div>
    </section>
  </template>
  
  <script setup>
  import { ref, onMounted } from 'vue'
  const props = defineProps({
    setSectionRef: {
      type: Function,
      required: true
    }
  });

  const sectionRef = ref(null);

  onMounted(() => {
    props.setSectionRef(sectionRef.value); // 将分屏 ref 传递给父组件
    console.log('分屏 3 渲染:', sectionRef.value);

  });
  </script>
  
  <style scoped>
  .screen3_container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: start;
    align-items: center;
  }
  .screen3_title {
    width: 100%;
    height: 15rem;
    line-height: 15rem;
    font-size: 4rem;
    text-align: center;
  }

  .screen3_demo {
    width: 100%;
    height: 70%;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
  }

  .screen3_demo video{
    height: 100%;
    aspect-ratio: 16 / 9; /* 设置视频比例，例如 16:9 */
  }
  </style>
  